package com.cxx.food.dto;

import com.fasterxml.jackson.annotation.JsonView;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Range;

import java.util.List;

@Getter
@Setter
@JsonView(PlainView.class)
public class RecipeDto {
    @Schema(description = "id")
    @JsonView(ReadView.class)
    private Long id;

    @Schema(description = "美食名称")
    @NotBlank(message = "名称不能为空")
    private String name;

    @Schema(description = "美食菜系")
    private String category;

    @Schema(description = "推荐指数")
    @Range(min = 0, max = 5, message = "推荐指数在0-5之间")
    private Integer recommendRate;

    @Schema(description = "是否分享")
    private Boolean isShare;

    @Schema(description = "美食食材")
    private List<MaterialDto> materialList;

    @Schema(description = "美食步骤")
    private List<StepDto> stepList;

    @Schema(description = "美食成果")
    @JsonView(ReadView.class)
    private List<RecordDto> recordList;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "用户id")
    @JsonView(ReadView.class)
    private Long userId;

    @Schema(description = "姓名")
    @JsonView(ReadView.class)
    private String username;

    @Schema(description = "头像")
    @JsonView(ReadView.class)
    private String avatar;

    @Schema(description = "点赞用户")
    @JsonView(ReadView.class)
    private List<Long> likeList;

    @Schema(description = "收藏用户")
    @JsonView(ReadView.class)
    private List<Long> favouriteList;

    @Schema(description = "评论内容")
    @JsonView(ReadView.class)
    private List<CommentDto> commentList;
}
